package com.my.mymafengwo.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.example.smallstrong.mafengwopro.R;
import com.my.mymafengwo.base.BaseActivity;
import com.my.mymafengwo.views.CustomEditText;

/**
 * ***********************************************
 * author:ljz
 * time:2015/12/7 12:31
 * name:
 * step:
 * ***********************************************
 */
public class StartSearchActivity extends BaseActivity {
    private TextView tv;
    private CustomEditText et;
    private String hint;

    @Override
    protected void loadXml() {
        setContentView(R.layout.activity_start_search);
    }

    @Override
    protected void getIntentData(Bundle savedInstanceState) {
        Intent intent = getIntent();
        hint = intent.getStringExtra("hint");
    }

    @Override
    protected void initViews() {
        tv = (TextView) findViewById(R.id.tv_back);
        et = (CustomEditText) findViewById(R.id.custom_et);
        et.setHint(hint);
    }

    @Override
    protected void registerListener() {
        tv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        et.setOnKeyListener(new View.OnKeyListener() {
            @Override
            public boolean onKey(View v, int keyCode, KeyEvent event) {
                Toast.makeText(StartSearchActivity.this, "搜索功能暂未开通", Toast.LENGTH_LONG).show();
                return false;
            }
        });
    }

    @Override
    protected void initData() {

    }
}
